******************************************
***CITIZEN PERCEPTIONS OF ONLINE ABUSE ***
******************************************
***Stata 17*******************************
******************************************

	*clear all 
	
**********************************
***Installing required packages***
**********************************
*Note, to execute correctly, this do-file requires the packages "estout", "coefplot" and "blindschemes" 
	* ssc install estout //Run this line if estout is not already installed (used when creating regression tables)
	* ssc install coefplot //Run this line if "Coefplot" is not already installed (used when plotting results in graphs)
	* ssc install blindschemes //Run this line if "blindschemes is not already installed (used to control graph layout) 
	
	set scheme plotplain
	graph set window fontface "Perpetua"
	gen mergenum = _n

**************************************
***Recoding and labelling variables***
**************************************

*Pre-treatment*

	*Ideology, Left-right
	recode left_right (99=.) 
		
	*Political trust
	tab1 pol_trust_0_10 pol_competent pol_personal_gain
	recode pol_trust_0_10 pol_competent pol_personal_gain (99=.)
	alpha pol_trust_0_10 pol_competent pol_personal_gain, gen(trust_index_uns) std item // trust index is reliable
	egen pol_trust_uns_min=min(trust_index_uns) //these lines standardize the measure to 0-1
	egen pol_trust_uns_max=max(trust_index_uns) //these lines standardize the measure to 0-1
	gen trust_index=(trust_index_uns-pol_trust_uns_min)/(pol_trust_uns_max-pol_trust_uns_min) //these lines standardize the measure to 0-1
	drop trust_index_uns pol_trust_uns_min pol_trust_uns_max
	
*Treatment*
	
	*Messagetype
	recode message1 (1/5=1 "Criticism") (6/10=2 "Insult") (11/15=3 "Threat") (16/20=4 "Sexism"), gen(messagetype1) 
	recode message2 (1/5=1 "Criticism") (6/10=2 "Insult") (11/15=3 "Threat") (16/20=4 "Sexism"), gen(messagetype2) 
	recode message3 (1/5=1 "Criticism") (6/10=2 "Insult") (11/15=3 "Threat") (16/20=4 "Sexism"), gen(messagetype3) 
	recode message4 (1/5=1 "Criticism") (6/10=2 "Insult") (11/15=3 "Threat") (16/20=4 "Sexism"), gen(messagetype4)
	
	*Party of ficticious politician
		*Creating variables, which indicate whether respondent's own party is same party as party of ficticious politician (i.e., ficticious politician is inparty)
		gen ownparty1=0
			recode ownparty1 (0=1) if vote==party1
		gen ownparty2=0
			recode ownparty2 (0=1) if vote==party2
		gen ownparty3=0
			recode ownparty3 (0=1) if vote==party3
		gen ownparty4=0
			recode ownparty4 (0=1) if vote==party4
		label define inparty 0 "Outparty" 1 "Inparty"
		label values  ownparty1 ownparty2 ownparty3 ownparty4 inparty
		
		*Party of ficticious politician - PARTY ID
		*Creating variables, which indicate whether respondent's own party ID is same party as party of ficticious politician (i.e., ficticious politician is inparty)
			gen ownpartyID1=0
				recode ownpartyID1 (0=1) if party_id_or_closer==party1
			gen ownpartyID2=0
				recode ownpartyID2 (0=1) if party_id_or_closer==party2
			gen ownpartyID3=0
				recode ownpartyID3 (0=1) if party_id_or_closer==party3
			gen ownpartyID4=0
				recode ownpartyID4 (0=1) if party_id_or_closer==party4
			label define inpartyID 0 "OutpartyID" 1 "InpartyID"
			label values  ownpartyID1 ownpartyID2 ownpartyID3 ownpartyID4 inpartyID
				
		*Party of ficticious politician - PARTY ID without leaner
		*Creating variables, which indicate whether respondent's own party ID is same party as party of ficticious politician (i.e., ficticious politician is inparty)
			gen ownpartyIDnoleaner1=0
				recode ownpartyIDnoleaner1 (0=1) if party_id==party1
			gen ownpartyIDnoleaner2=0
				recode ownpartyIDnoleaner2 (0=1) if party_id==party2
			gen ownpartyIDnoleaner3=0
				recode ownpartyIDnoleaner3 (0=1) if party_id==party3
			gen ownpartyIDnoleaner4=0
				recode ownpartyIDnoleaner4 (0=1) if party_id_or_closer==party4
			recode ownpartyIDnoleaner1 ownpartyIDnoleaner2 ownpartyIDnoleaner3 ownpartyIDnoleaner4 (0 1=.) if party_closer!=.
			label define inpartyIDnoleaner 0 "OutpartyID" 1 "InpartyID"
			label values  ownpartyIDnoleaner1 ownpartyIDnoleaner2 ownpartyIDnoleaner3 ownpartyIDnoleaner4 inpartyIDnoleaner	

	*Sympathy for party of ficticious politician
	recode symp_Soc_Dem symp_Soc_Lib symp_Conservative symp_New_Right symp_Socialist symp_Lib_A symp_Moderates symp_Danish_P_P symp_Liberals symp_Unity_List symp_Denmark_D symp_Alternative (99=.)
	
	forvalues j=1/4 {
		gen fic_pol_sym`j'=.
		replace fic_pol_sym`j'=symp_Soc_Dem 		if party`j'==1 
		replace fic_pol_sym`j'=symp_Soc_Lib 		if party`j'==2 
		replace fic_pol_sym`j'=symp_Conservative 	if party`j'==3 
		replace fic_pol_sym`j'=symp_New_Right		if party`j'==4 
		replace fic_pol_sym`j'=symp_Socialist 		if party`j'==5 
		replace fic_pol_sym`j'=symp_Lib_A 			if party`j'==6 
		replace fic_pol_sym`j'=symp_Moderates		if party`j'==8 
		replace fic_pol_sym`j'=symp_Danish_P_P		if party`j'==9 
		replace fic_pol_sym`j'=symp_Liberals 		if party`j'==11 
		replace fic_pol_sym`j'=symp_Unity_List		if party`j'==12 
		replace fic_pol_sym`j'=symp_Denmark_D		if party`j'==13 
		replace fic_pol_sym`j'=symp_Alternative		if party`j'==14 		
	}
		
	*Overall sympathy 
	 alpha symp_Soc_Dem symp_Soc_Lib symp_Conservative symp_New_Right symp_Socialist symp_Lib_A symp_Moderates symp_Danish_P_P symp_Liberals symp_Unity_List symp_Denmark_D symp_Alternative, item asis gen(sympathy_gen)
	
*Post-treatment variables*	
	tab1 abusive_1 legit_1 report_1 abusive_2 legit_2 report_2 abusive_3 legit_3 report_3 abusive_4 legit_4 report_4  // Share of "Don't know" answers relatively low (highest on "report-variables")

	*Recoding post-treatment variables to 0-1 range
	foreach var of varlist abusive_1 legit_1 report_1 abusive_2 legit_2 report_2 abusive_3 legit_3 report_3 abusive_4 legit_4 report_4 {
	recode `var' (99=.)
	gen `var'_std=(`var'-1)/6 
	}

	gen abusive1 	= abusive_1_std 
	gen legit1 		= legit_1_std 
	gen report1 	= report_1_std 
	gen abusive2 	= abusive_2_std 
	gen legit2 		= legit_2_std 	
	gen report2 	= report_2_std 	
	gen abusive3 	= abusive_3_std 	
	gen legit3 		= legit_3_std 
	gen report3 	= report_3_std 	
	gen abusive4 	= abusive_4_std
	gen legit4 		= legit_4_std 
	gen report4 	= report_4_std
	
	*Dropping obsolete variables	
	drop 	abusive_1 legit_1 report_1 abusive_2 legit_2 report_2 abusive_3 legit_3 report_3 abusive_4 legit_4 report_4 ///
			abusive_1_std legit_1_std report_1_std abusive_2_std legit_2_std report_2_std abusive_3_std legit_3_std report_3_std abusive_4_std legit_4_std report_4_std 

	
**************
***ANALYSES***
**************

*Macros used to set graph looks:

	* the "mlabel" macro is used (in a really clunky way!) to ensure trailing zeroes in the marker label values
	#delimit ;
	global 	mlabel `"mlabel(cond(@b>.095&@b<.105,".10", 
							cond(@b>.195&@b<.205,".20",	
							cond(@b>.295&@b<.305,".30", 
							cond(@b>.395&@b<.405,".40",
							cond(@b>.495&@b<.505,".50",
							cond(@b>.595&@b<.605,".60",
							cond(@b>.695&@b<.705,".70",
							cond(@b>.795&@b<.805,".80",
							cond(@b>.895&@b<.905,".90",
							cond(@b>.995,"1.00", 
							string(@b, "%9.2g")))))))))))) 
							mlabposition(2)"' ;
							#delimit cr

*Macro containing variables added in the supplementary models
	global controls "i.woman age left_right trust_index"
	
*******************************
***Non-experimental analyses***
*******************************

*Sample characteristics
	tab woman 				if completed_questionnaire==1 // gender
	sum age   				if completed_questionnaire==1 // age NOTE! The age variable has been truncated at 81 (to ensure anonymity of all participants) Results therefore differ marginally from results in article
	tab vote  				if completed_questionnaire==1 // party
	sum left_right			if completed_questionnaire==1 // Left-right position
	sum interest			if completed_questionnaire==1 // Political interest
	sum trust_index			if completed_questionnaire==1 // Political trust (index)
	
*Social media use 
	tab1 some_facebook some_twitter some_instagram some_other

*****************************
***Analyses of experiments***
*****************************

*Attrition
tab completed_questionnaire
tab completed_questionnaire  some_other, col  // just 9 respondents attrit after last/secondlast question before experiment: post-treatment attrition below .5%

*To analyze the experiment, dataset is reshaped from "wide" to "long"
	reshape long 	name gender_post pronoun message messagetype channel_post  ///
					abusive legit report ///
					ownparty ownpartyID ownpartyIDnoleaner fic_pol_lr lr_distance	fic_pol_sym ///
					, i(mergenum) j(trial)
	
*Constructing the DV-index
	alpha abusive legit report, min(2) item std gen(aversion_uns)
	egen aversion_uns_min=min(aversion_uns) //these lines standardize the measure to 0-1
	egen aversion_uns_max=max(aversion_uns) //these lines standardize the measure to 0-1
	gen aversion=(aversion_uns-aversion_uns_min)/(aversion_uns_max-aversion_uns_min) //these lines standardize the measure to 0-1
	drop aversion_uns aversion_uns_min aversion_uns_max
			alpha abusive legit, min(2) item std gen(aversion_uns)
			egen aversion_uns_min=min(aversion_uns) //these lines standardize the measure to 0-1
			egen aversion_uns_max=max(aversion_uns) //these lines standardize the measure to 0-1
			gen aversion_noreport=1-((aversion_uns-aversion_uns_min)/(aversion_uns_max-aversion_uns_min)) //these lines standardize the measure to 0-1 and turn it around to have same direction as original measure (1=high aversion)
			drop aversion_uns aversion_uns_min aversion_uns_max
	
*Descriptive results, individual items
	reg abusive i.message, cluster(mergenum) 
	margins i.message 
	*coefplot, title("Abusive")

	reg legit i.message, cluster(mergenum) 
	margins i.message 
	*coefplot, title("Legit")

	reg report i.message, cluster(mergenum) 
	margins i.message 
	*coefplot, title("Report")
	
*Descriptive results, index (FIGURE A1)
	reg aversion i.message, cluster(mergenum) 
	margins i.message, post 
	coefplot, 	headings(1.message = "{bf: Criticism}" 6.message = "{bf: Insults}" 11.message = "{bf: Threats}" 16.message = "{bf: Sexism}" ,  labsize(medlarge)) ///
				grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium)) xlabel(0(.1)1, labsize(medium) nogrid) msize(medium) msymbol(circle) mlcolor(black) xsize(6) ysize(3) legend(off) ciopts(color(black)) ///
				 $mlabel mlabposition(3) mlabgap(*3) mlabsize(medium) 	graphregion(margin(l=-8))			
				graph export aversion_all_comments.tif, replace

	tabstat aversion, statistics( mean sd min max ) by(message)

	*Histogram (FGURE A2)
	graph bar, 	over(abusive, relabel(1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" ) ) ///
				by(, title("                              " "The comment" "is abusive", position(9) ) note("")) by(, legend(off))  by(messagetype, rows(1))  blabel(bar, format(%9.0f"%")) ytitle("") yscale(r(0 85)) ///
				subtitle(, size(large)) ylabel(0(10)80, labsize(medium) glwidth(*0.25) glpattern(solid))
				graph save abusive_bar, replace
	graph bar, 	over(legit, relabel(1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" ) ) ///
				by(, title("Politicians should" "be able to tolerate" "comments like this", position(9) ) note("")) by(, legend(off)) by(messagetype, rows(1))  blabel(bar, format(%9.0f"%")) ///
				subtitle(, size(zero) color(none) nobox fcolor()) ytitle("") ylabel(0(10)80, labsize(medium) glwidth(*0.25) glpattern(solid))
				graph save legit_bar, replace
	graph bar, 	over(report, relabel(1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" ) ) ///
				by(, title("I would report" "this message to" "Twitter/Facebook", position(9)) note(""))  by(messagetype, rows(1))  blabel(bar, format(%9.0f"%")) ///
				subtitle(, size(zero) color(none) nobox fcolor()) ytitle("") yscale(r(0 80)) ylabel(0(10)80, labsize(medium) glwidth(*0.25) glpattern(solid)) 
				graph save report_bar, replace
	graph combine abusive_bar.gph legit_bar.gph report_bar.gph, row(3) ycommon xsize(6) ysize(4) imargin(zero)
	graph export items_aversion.tif, replace
	erase abusive_bar.gph 
	erase legit_bar.gph 
	erase report_bar.gph
  

  	reg abusive i.messagetype, cluster(mergenum) 
	margins i.messagetype, post
	eststo abusive_fig
	
	reg legit i.messagetype, cluster(mergenum) 
	margins i.messagetype, post
	eststo legit_fig
	
	reg report i.messagetype, cluster(mergenum) 
	margins i.messagetype, post
	eststo report_fig
	
	reg aversion i.messagetype, cluster(mergenum) 
	margins i.messagetype, post
	eststo index_fig
	
	* Mean Aversion by Outcome Measures and the Type of Negative Comments (FIGURE 1)
	coefplot 	(abusive_fig, mfcolor(gs6)) , 	bylabel("The comment" "is abusive") subtitle(, size(medlarge)) || 	///
				(legit_fig, mfcolor(gs6)),	bylabel("Politicians should be able" "to tolerate comments like this") || ///
				(report_fig, mfcolor(gs6)), 	bylabel("I would report this message" "to [Twitter/Facebook]") ||   ///
				(index_fig, mfcolor(gs6)), 	bylabel("Index")   ///
				byopts(row(1) legend(off))  ///
				coeflabels(1.messagetype = "Criticism" 2.messagetype = "Insults" 3.messagetype = "Threats" 4.messagetype= "Sexism") ///
				grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium))  xlabel(0(.1)1, labsize(medium) nogrid) msize(large) msymbol(circle) mlcolor(black) xsize(6) ysize(3) ciopts(color(black)) $mlabel mlabsize(medium)  
				graph export items_descriptive.tif, replace
				
	
  
*HYPOTHESIS 1: "Citizens are more averse to negative messages directed at a politician from their preferred party than negative messages directed at a politician from another party"

	*Primary model
	reg aversion i.messagetype##i.ownparty, cluster(mergenum) 
	eststo aversion_ownparty
	margin ownparty
	margin, dydx(ownparty)								// These results determine H1!
	margin, dydx(ownparty) at(messagetype=(1 2 3 4))  	// These results determine H1!
	sum aversion if messagetype==3
	di .019309/.177258
	sum aversion
	di 	.019309/.2805974
	tab abusive ownparty if messagetype==3, col chi
		*Primary with alternative DV
		reg aversion_noreport i.messagetype##i.ownparty, cluster(mergenum) 
		eststo aversion_ownparty_noreport
		margin, dydx(ownparty)								// Substantively similar results 
		margin, dydx(ownparty) at(messagetype=(1 2 3 4))  	// Substantively similar results 
		*Primary with PARTY ID
		reg aversion i.messagetype##i.ownpartyID, cluster(mergenum) 
		eststo aversion_ownpartyID
		margin, dydx(ownpartyID)								//  
		margin, dydx(ownpartyID) at(messagetype=(1 2 3 4))  	// 
		*Primary with PARTY ID - no leaner
		reg aversion i.messagetype##i.ownpartyIDnoleaner, cluster(mergenum) 
		eststo aversion_ownpartyIDnoleaner
		margin, dydx(ownpartyIDnoleaner)								// 
		margin, dydx(ownpartyIDnoleaner) at(messagetype=(1 2 3 4))  	// 
		*Primary model with party sympathy
		reg aversion i.messagetype##c.fic_pol_sym, cluster(mergenum)
		eststo aversion_symp
		margin, dydx(fic_pol_sym) 							// 
		margin, dydx(fic_pol_sym) at(messagetype=(1 2 3 4)) 	// 
		
		
	*Supplementary model
	reg aversion i.messagetype##i.ownparty $controls, cluster(mergenum) 
	eststo aversion_ownparty_sup
	margin, dydx(ownparty)								
	margin, dydx(ownparty) at(messagetype=(1 2 3 4))  	
	margin (ownparty) if messagetype==4
	
	*FIGURE: Aversion to negative messages, conditional on partisanship as party vote (FIGURE 2)
	estimates restore aversion_ownparty
	margins 	ownparty, post
	eststo 		aversion_ownparty_fig_grand
	estimates restore aversion_ownparty
	margins 	i.messagetype#ownparty, post
	eststo 		aversion_ownparty_fig
	coefplot 	(aversion_ownparty_fig_grand, mfcolor(gs6) keep(0.ownparty)) (aversion_ownparty_fig_grand, mfcolor(white) keep(1.ownparty)) ///
				(aversion_ownparty_fig, mfcolor(gs6) keep(*#0.ownparty)) (aversion_ownparty_fig, mfcolor(white) keep(*#1.ownparty)), ///
				headings(0.ownparty = "{bf: All comments}" 1.messagetype#0.ownparty = "{bf: Criticism}" 2.messagetype#0.ownparty = "{bf: Insults}" 3.messagetype#0.ownparty = "{bf: Threats}" 4.messagetype#0.ownparty = "{bf: Sexism}", ///
				labsize(medlarge) ) ///
				coeflabels(0.ownparty 1.messagetype#0.ownparty  2.messagetype#0.ownparty  3.messagetype#0.ownparty  4.messagetype#0.ownparty  = "Another party" ///
				1.ownparty 1.messagetype#1.ownparty  2.messagetype#1.ownparty  3.messagetype#1.ownparty  4.messagetype#1.ownparty  = "Own party") ///
				order(0.ownparty 1.ownparty 1.messagetype#0.ownparty 1.messagetype#1.ownparty  2.messagetype#0.ownparty 2.messagetype#1.ownparty   3.messagetype#0.ownparty  3.messagetype#1.ownparty  /// 
				4.messagetype#0.ownparty  4.messagetype#1.ownparty  ) ///
				grid(within glpattern(solid) glwidth(*0.25))  title("") ylabel(,labsize(medium))  xlabel(0(.1)1, labsize(medium) nogrid) msize(large) msymbol(circle) mlcolor(black) xsize(6) ysize(3) legend(off) ciopts(color(black)) ///
				$mlabel mlabsize(medium)
 				graph export aversion_ownparty.tif, replace
				
	*FIGURE: Aversion to negative messages, conditional on partisanship as PARTY ID	(FIGURE A3)	
	estimates restore aversion_ownpartyID
	margins 	ownpartyID, post
	eststo 		aversion_ownPID_fig_grand
	estimates restore aversion_ownpartyID
	margins 	i.messagetype#ownpartyID, post
	eststo 		aversion_ownpartyID_fig
	coefplot 	(aversion_ownPID_fig_grand, mfcolor(gs6) keep(0.ownpartyID)) (aversion_ownPID_fig_grand, mfcolor(white) keep(1.ownpartyID)) ///
				(aversion_ownpartyID_fig, mfcolor(gs6) keep(*#0.ownpartyID)) (aversion_ownpartyID_fig, mfcolor(white) keep(*#1.ownpartyID)), ///
				headings(0.ownpartyID = "{bf: All comments}" 1.messagetype#0.ownpartyID = "{bf: Criticism}" 2.messagetype#0.ownpartyID = "{bf: Insults}" 3.messagetype#0.ownpartyID = "{bf: Threats}" 4.messagetype#0.ownpartyID = "{bf: Sexism}", ///
				labsize(medlarge) ) ///
				coeflabels(0.ownpartyID 1.messagetype#0.ownpartyID  2.messagetype#0.ownpartyID  3.messagetype#0.ownpartyID  4.messagetype#0.ownpartyID  = "Another party" ///
				1.ownpartyID 1.messagetype#1.ownpartyID  2.messagetype#1.ownpartyID  3.messagetype#1.ownpartyID  4.messagetype#1.ownpartyID  = "Own party") ///
				order(0.ownpartyID 1.ownpartyID 1.messagetype#0.ownpartyID 1.messagetype#1.ownpartyID  2.messagetype#0.ownpartyID 2.messagetype#1.ownpartyID   3.messagetype#0.ownpartyID  3.messagetype#1.ownpartyID  /// 
				4.messagetype#0.ownpartyID  4.messagetype#1.ownpartyID  ) ///
				grid(within glpattern(solid) glwidth(*0.25))  title("") ylabel(,labsize(medium))  xlabel(0(.1)1, labsize(medium) nogrid) msize(large) msymbol(circle) mlcolor(black) xsize(6) ysize(3) legend(off) ciopts(color(black)) ///
				$mlabel mlabsize(medium)
 				graph export aversion_ownpartyID.tif, replace	
				
	*FIGURE: Aversion to negative messages, conditional on partisanship as PARTY ID	WITHOUT LEANERS	(FIGURE A4)		
	estimates restore aversion_ownpartyIDnoleaner
	margins 	ownpartyIDnoleaner, post
	eststo 		aversion_ownPIDnl_fig_grand
	estimates restore aversion_ownpartyIDnoleaner
	margins 	i.messagetype#ownpartyIDnoleaner, post
	eststo 		aversion_ownpartyIDnl_fig
	coefplot 	(aversion_ownPIDnl_fig_grand, mfcolor(gs6) keep(0.ownpartyIDnoleaner)) (aversion_ownPIDnl_fig_grand, mfcolor(white) keep(1.ownpartyIDnoleaner)) 	///
				(aversion_ownpartyIDnl_fig, mfcolor(gs6) keep(*#0.ownpartyIDnoleaner)) (aversion_ownpartyIDnl_fig, mfcolor(white) keep(*#1.ownpartyIDnoleaner)), ///
				headings(0.ownpartyIDnoleaner = "{bf: All comments}" 1.messagetype#0.ownpartyIDnoleaner = "{bf: Criticism}" 2.messagetype#0.ownpartyIDnoleaner = "{bf: Insults}" ///
				3.messagetype#0.ownpartyIDnoleaner = "{bf: Threats}" 4.messagetype#0.ownpartyIDnoleaner = "{bf: Sexism}", labsize(medlarge) ) ///
				coeflabels(0.ownpartyIDnoleaner 1.messagetype#0.ownpartyIDnoleaner  2.messagetype#0.ownpartyIDnoleaner  3.messagetype#0.ownpartyIDnoleaner  4.messagetype#0.ownpartyIDnoleaner  = "Another party" ///
				1.ownpartyIDnoleaner 1.messagetype#1.ownpartyIDnoleaner  2.messagetype#1.ownpartyIDnoleaner  3.messagetype#1.ownpartyIDnoleaner  4.messagetype#1.ownpartyIDnoleaner  = "Own party") ///
				order(0.ownpartyIDnoleaner 1.ownpartyIDnoleaner 1.messagetype#0.ownpartyIDnoleaner 1.messagetype#1.ownpartyIDnoleaner  2.messagetype#0.ownpartyIDnoleaner 2.messagetype#1.ownpartyIDnoleaner  ///
				3.messagetype#0.ownpartyIDnoleaner  3.messagetype#1.ownpartyIDnoleaner  4.messagetype#0.ownpartyIDnoleaner  4.messagetype#1.ownpartyIDnoleaner  ) ///
				grid(within glpattern(solid) glwidth(*0.25))  title("") ylabel(,labsize(medium))  xlabel(0(.1)1, labsize(medium) nogrid) msize(large) msymbol(circle) mlcolor(black) xsize(6) ysize(3) legend(off) ciopts(color(black)) ///
				$mlabel mlabsize(medium)
 				graph export aversion_ownpartyIDnl.tif, replace			
		
	*FIGURE: Aversion to negative messages, conditional on SYMPATHY (FIGURE A5)
	estimates restore aversion_symp
	margins, at(fic_pol_sym=(0 2 4 6 8 10)) post
	eststo aversion_symp_fig_grand
	estimates restore aversion_symp
	margins, at(messagetype=(1 2 3 4) fic_pol_sym=(0 2 4 6 8 10)) post
	eststo aversion_symp_fig
	coefplot 	(aversion_symp_fig_grand, ciopts(lwidth(thin) lcolor(black)) rename(*._at=._atg)) ///
				(aversion_symp_fig_grand, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at ) rename(*._at=._atg)  noci) ///
				(aversion_symp_fig_grand, $mlabel mlabposition(6) mlabgap(*.01) keep(6._at ) rename(*._at=._atg) noci) ///
				(aversion_symp_fig, ciopts(lwidth(thin) lcolor(black))) ///
				(aversion_symp_fig, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at 7._at 13._at 19._at ) noci) ///
				(aversion_symp_fig, $mlabel mlabposition(6) mlabgap(*.01) keep(6._at 12._at  18._at 24._at) noci), ///
				headings(1._atg = `" "{bf: All comments}" " " "' 1._at = `" "{bf: Criticism}" " " "' 7._at = `" "{bf: Insults}" " " "' 13._at = `" "{bf: Threats}" " " "' 19._at = `" "{bf: Sexism}" " " "', gap(5) labsize(medlarge) wrap(5) ) 	///
				coeflabels(	1._atg  1._at  7._at 13._at 19._at = "0: Dislike" ///
							2._atg  2._at  8._at 14._at 20._at = " " ///
							3._atg 3._at  9._at 15._at 21._at = " " ///
							4._atg 4._at  10._at 16._at 22._at = " " ///
							5._atg  5._at  11._at 17._at 23._at = " " ///
							6._atg 6._at  12._at 18._at 24._at = "10: Like" ) ///
							grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium)) xlabel(0(.1)1, labsize(medium) nogrid) msymbol(circle) mlcolor(black) mfcolor(white) mlwidth(thin) ciopts(color(black)) ///
							xsize(6) ysize(3) legend(off) nooffset plotregion(margin(medium)) mlabsize(medium)  
				graph export aversion_symp.tif, replace	
				
	
*HYPOTHESIS 2a:  "Aversion to sexist messages is stronger among citizens on the political left than among citizens on the political right" 
*HYPOTHESIS 2b: "Aversion to negative messages differs between citizens on the political left and citizens on the political right"

	*Primary model
	reg aversion i.messagetype##c.left_right, cluster(mergenum)
	eststo aversion_lr
	margin, dydx(left_right) 							// These results determine H2 and H2b
	margin, dydx(left_right) at(messagetype=(1 2 3 4)) 	// These results determine H2 and H2b
	margins, at(messagetype=(4) left_right=(0 1 2 3 4 5 6 7 8 9 10))
		*Primary with alternative DV
		reg aversion_noreport i.messagetype##c.left_right, cluster(mergenum)
		eststo aversion_lr_noreport
		margin, dydx(left_right) 							// Substantively similar results 
		margin, dydx(left_right) at(messagetype=(1 2 3 4)) 	// Substantively similar results 
	
	*Supplementary model
	reg aversion i.messagetype##c.left_right $controls, cluster(mergenum)
	eststo aversion_lr_sup
	margin, dydx(left_right) 							
	margin, dydx(left_right) at(messagetype=(1 2 3 4)) 	
	margins, at(messagetype=(1 2 3 4) left_right=(0 1 2 3 4 5 6 7 8 9 10)) post	
		
	*FIGURE: Aversion to negative messages, conditional on LR (FIGURE 3)
	estimates restore aversion_lr
	margins, at(left_right=(0 2 4 6 8 10)) post
	eststo aversion_lr_fig_grand
	estimates restore aversion_lr
	margins, at(messagetype=(1 2 3 4) left_right=(0 2 4 6 8 10)) post
	eststo aversion_lr_fig
	coefplot 	(aversion_lr_fig_grand, ciopts(lwidth(thin) lcolor(black)) rename(*._at=._atg)) ///
				(aversion_lr_fig_grand, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at ) rename(*._at=._atg)  noci) ///
				(aversion_lr_fig_grand, $mlabel mlabposition(6) mlabgap(*.01) keep(6._at ) rename(*._at=._atg) noci) ///
				(aversion_lr_fig, ciopts(lwidth(thin) lcolor(black))) ///
				(aversion_lr_fig, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at 7._at 13._at 19._at ) noci) ///
				(aversion_lr_fig, $mlabel mlabposition(6) mlabgap(*.01) keep(6._at 12._at  18._at 24._at) noci), ///
				headings(1._atg = `" "{bf: All comments}" " " "' 1._at = `" "{bf: Criticism}" " " "' 7._at = `" "{bf: Insults}" " " "' 13._at = `" "{bf: Threats}" " " "' 19._at = `" "{bf: Sexism}" " " "', gap(5) labsize(medlarge) wrap(5) ) 	///
				coeflabels(	1._atg  1._at  7._at 13._at 19._at = "0: left" ///
							2._atg  2._at  8._at 14._at 20._at = " " ///
							3._atg 3._at  9._at 15._at 21._at = " " ///
							4._atg 4._at  10._at 16._at 22._at = " " ///
							5._atg  5._at  11._at 17._at 23._at = " " ///
							6._atg 6._at  12._at 18._at 24._at = "10: right" ) ///
							grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium)) xlabel(0(.1)1, labsize(medium) nogrid) msymbol(circle) mlcolor(black) mfcolor(white) mlwidth(thin) ciopts(color(black)) ///
							xsize(6) ysize(3) legend(off) nooffset plotregion(margin(medium)) mlabsize(medium)  
				graph export aversion_lr.tif, replace			
					
	
	
*HYPOTHESIS 3: "Aversion to negative messages is stronger among citizens with a high trust in politicians compared to citizens with a low trust in politicians"

	*Primary model
	reg aversion i.messagetype##c.trust_index, cluster(mergenum)
	eststo aversion_trust
	margin, dydx(trust_index) 							// These results determine H5
	margin, dydx(trust_index) at(messagetype=(1 2 3 4)) 	// These results determine H5
	margins, at(messagetype=(4) trust_index=(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1.0))
		*Primary with alternative DV
		reg aversion_noreport i.messagetype##c.trust_index, cluster(mergenum)
		eststo aversion_trust_noreport
		margin, dydx(trust_index) 							// Substantively similar results
		margin, dydx(trust_index) at(messagetype=(1 2 3 4)) 	// Substantively similar results
	
	*Supplementary model
	reg aversion i.messagetype##c.trust_index $controls, cluster(mergenum)
	eststo aversion_trust_sup
	margin, dydx(trust_index) 							// These results determine H2 and H2b
	margin, dydx(trust_index) at(messagetype=(1 2 3 4)) 	// These results determine H2 and H2b
	margins, at(messagetype=(4) trust_index=(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1.0))
		
	*FIGURE: Aversion to negative messages, conditional on trust (FIGURE 4)
	estimates restore aversion_trust
	margins, at(trust_index=(0 .2 .4 .6 .8 1.0)) post
	eststo aversion_trust_grand
	estimates restore aversion_trust
	margins, at(messagetype=(1 2 3 4) trust_index=(0 .2 .4 .6 .8 1.0)) post
	eststo aversion_trust_fig
	coefplot 	(aversion_trust_grand, ciopts(lwidth(thin) lcolor(black)) rename(*._at=._atg)) ///
				(aversion_trust_grand, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at ) rename(*._at=._atg)  noci) ///
				(aversion_trust_grand, $mlabel mlabposition(6) mlabgap(*.01) keep(6._at ) rename(*._at=._atg) noci) ///
				(aversion_trust_fig, ciopts(lwidth(thin) lcolor(black))) ///
				(aversion_trust_fig, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at 7._at 13._at 19._at ) noci) ///
				(aversion_trust_fig, $mlabel mlabposition(6) mlabgap(*.01) keep(6._at 12._at  18._at 24._at) noci), ///
				headings(1._atg = `" "{bf: All comments}" " " "'  1._at = `" "{bf: Criticism}" " " "' 7._at = `" "{bf: Insults}" " " "' 13._at = `" "{bf: Threats}" " " "' 19._at = `" "{bf: Sexism}" " " "', gap(5) labsize(medlarge) ) 	///
				coeflabels(	1._atg  1._at  7._at 13._at 19._at = "0: no trust" ///
							2._atg 2._at  8._at 14._at 20._at = " " ///
							3._atg 3._at  9._at 15._at 21._at = " " ///
							4._atg 4._at  10._at 16._at 22._at = " " ///
							5._atg 5._at  11._at 17._at 23._at = " " ///
							6._atg 6._at  12._at 18._at 24._at = "1: complete trust" ) ///
							grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium)) xlabel(0(.1)1, labsize(medium) nogrid) msymbol(circle) mlcolor(black) mfcolor(white) mlwidth(thin) ciopts(color(black)) ///
							xsize(6) ysize(3) legend(off) nooffset plotregion(margin(medium)) mlabsize(medium)
				graph export aversion_trust.tif, replace			
					
	
	***Composites of trust
	reg aversion i.messagetype##c.pol_trust_0_10 
	eststo trust0_10
	margin, dydx(pol_trust_0_10) 							// 
	margin, dydx(pol_trust_0_10) at(messagetype=(1 2 3 4)) 	// 
	margins, at(messagetype=(1 2 3 4) pol_trust_0_10=(0 2 4 6 8 10)) post
	eststo trust0_10_fig
	
	reg aversion i.messagetype##c.pol_competent 
	eststo trust_competent
	margin, dydx(pol_competent) 							// 
	margin, dydx(pol_competent) at(messagetype=(1 2 3 4)) 	// 
	margins, at(messagetype=(1 2 3 4) pol_competent =(1 2 3 4 5)) post
	eststo pol_comp_fig
	
	reg aversion i.messagetype##c.pol_personal_gain
	eststo trust_personalgain
	margin, dydx(pol_personal_gain) 							// 
	margin, dydx(pol_personal_gain) at(messagetype=(1 2 3 4)) 	// 
	margins, at(messagetype=(1 2 3 4) pol_personal_gain=(1 2 3 4 5)) post
	eststo pol_gain_fig

		
		*THE COMPOSITES OF TRUST - FIGURE A6
		coefplot 	(trust0_10_fig, ciopts(lwidth(thin) lcolor(black))) ///
					(trust0_10_fig, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at 7._at 13._at 19._at ) noci) ///
					(trust0_10_fig, $mlabel mlabposition(6) mlabgap(*.01) keep(6._at 12._at  18._at 24._at) noci), ///
					headings(1._at = `" "{bf: Criticism}" " " "' 7._at = `" "{bf: Insults}" " " "' 13._at = `" "{bf: Threats}" " " "' 19._at = `" "{bf: Sexism}" " " "', gap(5) labsize(medlarge) ) 	///
					coeflabels(	1._atg  1._at  7._at 13._at 19._at = "0" ///
								2._atg 2._at  8._at 14._at 20._at = " " ///
								3._atg 3._at  9._at 15._at 21._at = " " ///
								4._atg 4._at  10._at 16._at 22._at = " " ///
								5._atg 5._at  11._at 17._at 23._at = " " ///
								6._atg 6._at  12._at 18._at 24._at = "10" ) ///
								grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium)) xlabel(0(.1)1, labsize(medium) nogrid) msymbol(circle) mlcolor(black) mfcolor(white) mlwidth(thin) ciopts(color(black)) ///
								xsize(6) ysize(3) legend(off) nooffset plotregion(margin(medium)) mlabsize(medium) ///
								title("How much trust do you" "generally have in Danish politicians?" "                                                              ", size(large) box)
								graph save trust0_10.gph, replace
		coefplot 	(pol_comp_fig, ciopts(lwidth(thin) lcolor(black))) ///
					(pol_comp_fig, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at 6._at 11._at 16._at ) noci) ///
					(pol_comp_fig, $mlabel mlabposition(6) mlabgap(*.01) keep(5._at 10._at  15._at 20._at) noci), ///
					headings(1._at = `" "{bf: Criticism}" " " "' 6._at = `" "{bf: Insults}" " " "' 11._at = `" "{bf: Threats}" " " "' 16._at = `" "{bf: Sexism}" " " "', gap(5) labsize(medlarge) ) 	///
					coeflabels(	1._atg 1._at  6._at 11._at 16._at = "1" ///
								2._atg 2._at  7._at 12._at 17._at = " " ///
								3._atg 3._at  8._at 13._at 18._at = " " ///
								4._atg 4._at  9._at 14._at 19._at = " " ///
								5._atg 5._at  10._at 15._at 20._at = "5" ) ///
								grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium)) xlabel(0(.1)1, labsize(medium) nogrid) msymbol(circle) mlcolor(black) mfcolor(white) mlwidth(thin) ciopts(color(black)) ///
								xsize(6) ysize(3) legend(off) nooffset plotregion(margin(medium)) mlabsize(medium) ///
								title("Most politicians are competent" "people who know what they are doing" "                                                              ", size(large) box)						
								graph save pol_comp.gph, replace
		coefplot 	(pol_gain_fig, ciopts(lwidth(thin) lcolor(black))) ///
					(pol_gain_fig, $mlabel mlabposition(12) mlabgap(*.7) keep(1._at 6._at 11._at 16._at ) noci) ///
					(pol_gain_fig, $mlabel mlabposition(6) mlabgap(*.01) keep(5._at 10._at  15._at 20._at) noci), ///
					headings(1._at = `" "{bf: Criticism}" " " "' 6._at = `" "{bf: Insults}" " " "' 11._at = `" "{bf: Threats}" " " "' 16._at = `" "{bf: Sexism}" " " "', gap(5) labsize(medlarge) ) 	///
					coeflabels(	1._atg 1._at  6._at 11._at 16._at = "1" ///
								2._atg 2._at  7._at 12._at 17._at = " " ///
								3._atg 3._at  8._at 13._at 18._at = " " ///
								4._atg 4._at  9._at 14._at 19._at = " " ///
								5._atg 5._at  10._at 15._at 20._at = "5" ) ///
								grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium)) xlabel(0(.1)1, labsize(medium) nogrid) msymbol(circle) mlcolor(black) mfcolor(white) mlwidth(thin) ciopts(color(black)) ///
								xsize(6) ysize(3) legend(off) nooffset plotregion(margin(medium)) mlabsize(medium)	///
								title("Most politicians are in politics only" "for what they can get out of it personally" "                                                              ", size(large) box) 
								graph save pol_gain.gph, replace
		graph combine trust0_10.gph pol_comp.gph pol_gain.gph, col(3) xsize(6) ysize(2.5) 
				graph export trust_components.tif, replace
				
	
*HYPOTHESIS 4: "Citizens are more averse to negative comments directed at female politicians than negative comments directed at male politicians"

	*Primary model
	reg aversion i.messagetype##i.gender_post, cluster(mergenum) 
	eststo aversion_genderpost
	margins gender_post
	margins, dydx(gender_post)								// these results determine H3
	margins, dydx(gender_post) at(messagetype=(1 2 3 4)) 	// these results determine H3
			*Primary with alternative DV
			reg aversion_noreport i.messagetype##i.gender_post, cluster(mergenum) 
			eststo aversion_genderpost_norep
			margins gender_post
			margins, dydx(gender_post)								// Similar results
			margins, dydx(gender_post) at(messagetype=(1 2 3 4)) 	// Similar results
	
	*Supplementary model
	reg aversion i.messagetype##i.gender_post $controls, cluster(mergenum) 
	eststo aversion_genderpost_sup
	margins, dydx(gender_post)								
	margins, dydx(gender_post) at(messagetype=(1 2 3 4)) 	
	
	*FIGURE: Aversion to negative messages, conditional on gender of target (FIGURE 5)
	estimates restore aversion_genderpost
	margins gender_post, post
	eststo aversion_genderpost_grand	
	estimates restore aversion_genderpost
	margins i.messagetype#gender_post, post
	eststo aversion_genderpost_fig
	coefplot 	(aversion_genderpost_grand, mfcolor(gs6) keep(0.gender_post) ) (aversion_genderpost_grand, mfcolor(white) keep(1.gender_post)) ///
				(aversion_genderpost_fig, mfcolor(gs6) keep(*#0.gender_post) ) (aversion_genderpost_fig, mfcolor(white) keep(*#1.gender_post)), 	///
				headings(0.gender_post = "{bf: All comments}" 1.messagetype#0.gender_post = "{bf: Criticism}" 2.messagetype#0.gender_post = "{bf: Insults}" 3.messagetype#0.gender_post = "{bf: Threats}" ///
				4.messagetype#0.gender_post = "{bf: Sexism}", labsize(medlarge)) 	/// 
				coeflabels(0.gender_post 1.messagetype#0.gender_post 2.messagetype#0.gender_post 3.messagetype#0.gender_post 4.messagetype#0.gender_post = "Male target" ///
				1.gender_post 1.messagetype#1.gender_post 2.messagetype#1.gender_post 3.messagetype#1.gender_post 4.messagetype#1.gender_post = "Female target") ///
				order(0.gender_post 1.gender_post 1.messagetype#0.gender_post 1.messagetype#1.gender_post 2.messagetype#0.gender_post 2.messagetype#1.gender_post 3.messagetype#0.gender_post ///
				3.messagetype#1.gender_post  4.messagetype#0.gender_post 4.messagetype#1.gender_post ) ///
				grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium))  xlabel(0(.1)1, labsize(medium) nogrid) msize(large) msymbol(circle) mlcolor(black) xsize(6) ysize(3) legend(off) ciopts(color(black)) /// 
				$mlabel mlabsize(medium)
				graph export aversion_victim_gender.tif, replace

				
*HYPOTHESIS 5: "Women are more averse than men to negative comments"

	*Primary model
	reg aversion i.messagetype##i.woman, cluster(mergenum) 
	eststo aversion_woman
	margins, dydx(woman) 							// these results determine H4
	margins, dydx(woman) at(messagetype=(1 2 3 4)) 	// these results determine H4
	margins, at(woman=(0 1) messagetype=(1 2 3 4))
			reg aversion_noreport i.messagetype##i.woman, cluster(mergenum) 
			eststo aversion_woman_noreport
			margins, dydx(woman) 							// Similar results
			margins, dydx(woman) at(messagetype=(1 2 3 4)) 	// Similar results
		
	*Supplementary model
	reg aversion i.messagetype##i.woman $controls, cluster(mergenum) 
	eststo aversion_woman_sup
	margins, dydx(woman) 							
	margins, dydx(woman) at(messagetype=(1 2 3 4)) 	
	margins, at(woman=(0 1) messagetype=(1 2 3 4))
	
	*FIGURE: Aversion to negative messages, conditional on gender of respondent (FIGURE 6)
	estimates restore aversion_woman
	margins woman, post
	eststo aversion_woman_fig_grand
	estimates restore aversion_woman
	margins i.messagetype#woman, post
	eststo aversion_woman_fig
	coefplot	(aversion_woman_fig_grand, mfcolor(gs6) keep(0.woman)) ///
				(aversion_woman_fig_grand, mfcolor(white) keep(1.woman)) ///
				(aversion_woman_fig, mfcolor(gs6) keep(*#0.woman)) ///
				(aversion_woman_fig, mfcolor(white) keep(*#1.woman)), 	///
				nolabel headings(0.woman= "{bf: All comments}"  1.messagetype#0.woman= "{bf: Criticism}" 2.messagetype#0.woman = "{bf: Insults}" 3.messagetype#0.woman = "{bf: Threats}" ///
				4.messagetype#0.woman = "{bf: Sexism}",  labsize(medlarge) )  /// 
				coeflabels(0.woman 1.messagetype#0.woman 2.messagetype#0.woman 3.messagetype#0.woman 4.messagetype#0.woman = "Male respondent" ///
				1.woman 1.messagetype#1.woman 2.messagetype#1.woman 3.messagetype#1.woman 4.messagetype#1.woman = "Female respondent") ///
				order(0.woman 1.woman 1.messagetype#0.woman 1.messagetype#1.woman  2.messagetype#0.woman 2.messagetype#1.woman  3.messagetype#0.woman 3.messagetype#1.woman  4.messagetype#0.woman 4.messagetype#1.woman ) ///
				grid(within glpattern(solid) glwidth(*0.25)) title("") ylabel(,labsize(medium))  xlabel(0(.1)1, labsize(medium) nogrid) msize(large) msymbol(circle) mlcolor(black) xsize(6) ysize(3) legend(off) ciopts(color(black)) ///
				$mlabel mlabsize(medium)
				graph export aversion_respondentgender.tif, replace

	
	
***Other, exploratory, models****	
	

*Facebook versus Twitter
	reg aversion i.messagetype##i.channel_post, cluster(mergenum)
	margins, dydx(channel_post) 							// There are no significant difference in aversion to posts on Facebook vs. Twitter
	margins, dydx(channel_post) at(messagetype=(1 2 3 4)) 	// There are no significant difference in aversion to posts on Facebook vs. Twitter

*Interaction between gender of attacked politician and gender of respondent? (FIGURE A7)
	reg aversion i.woman##i.gender_post, cluster(mergenum)
	reg aversion i.woman##i.gender_post if messagetype==4, cluster(mergenum)
	reg aversion i.messagetype##i.woman##i.gender_post, cluster(mergenum) 
	eststo aversion_respondent_target
	margins, dydx(woman) at(gender_post=(0 1))						
	margins, dydx(woman) at(gender_post=(0 1) messagetype=(1 2 3 4)) 	
	
	estimates restore aversion_respondent_target
	margins i.messagetype#woman#gender_post, pwcompare post
	coefplot, 	title("") nolabel headings(1.messagetype#0.woman#0.gender_post= "{bf: Criticism}" 2.messagetype#0.woman#0.gender_post= "{bf: Insults}" ///
				3.messagetype#0.woman#0.gender_post = "{bf: Threats}" 4.messagetype#0.woman#0.gender_post = "{bf: Sexism}",  labsize(medium) ) /// 				
				coeflabels	(1.messagetype#0.woman#0.gender_post 2.messagetype#0.woman#0.gender_post 3.messagetype#0.woman#0.gender_post 4.messagetype#0.woman#0.gender_post = "Male respondent, male target" ///
							 1.messagetype#0.woman#1.gender_post 2.messagetype#0.woman#1.gender_post 3.messagetype#0.woman#1.gender_post 4.messagetype#0.woman#1.gender_post = "Male respondent, female target" ///
							 1.messagetype#1.woman#0.gender_post 2.messagetype#1.woman#0.gender_post 3.messagetype#1.woman#0.gender_post 4.messagetype#1.woman#0.gender_post = "Female respondent, male target" ///
							 1.messagetype#1.woman#1.gender_post 2.messagetype#1.woman#1.gender_post 3.messagetype#1.woman#1.gender_post 4.messagetype#1.woman#1.gender_post = "Female respondent, female target") ///
				ylabel(,labsize(small)) xlabel(0(.1)1) xsize(6) ysize(3) msymbol(circle) mlcolor(black) mfcolor(gs16)ciopts(color(black)) ///
				$mlabel mlabsize(medium)
				graph export commentypes_respondent_target.tif, replace		

	
************
***Tables***
************

		*Primary models (TABLE A1)
		esttab			aversion_ownparty aversion_lr aversion_trust aversion_genderpost aversion_woman 	using primary_models.rtf, replace r2 b(2) se(2) compress wide label  interaction(" x ") noomitted nomtitles  ///
		order(		1.messagetype	2.messagetype 3.messagetype 4.messagetype 0.ownparty 1.ownparty 1.messagetype#1.ownparty 2.messagetype#1.ownparty 3.messagetype#1.ownparty 4.messagetype#1.ownparty /// 
					left_right  1.messagetype#c.left_right 2.messagetype#c.left_right 3.messagetype#c.left_right 4.messagetype#c.left_right ///
					trust_index 1.messagetype#c.trust_index 2.messagetype#c.trust_index 3.messagetype#c.trust_index 4.messagetype#c.trust_index ///
					0.gender_post 1.gender_post 1.messagetype#1.gender_post  2.messagetype#1.gender_post 3.messagetype#1.gender_post 4.messagetype#1.gender_post ///
					0.woman 1.woman 1.messagetype#1.woman 2.messagetype#1.woman 3.messagetype#1.woman 4.messagetype#1.woman ///
					_cons ) ///
		refcat(		1.messagetype "{\i Comment type:}" 0.ownparty "{\i Partisanship:}" left_right "{\i Left-Right Position:}" 0.gender_post "{\i Gender of target:}"  0.woman "{\i Gender of respondent:}"   trust_index "{\i Political trust:}" ///
					, nolabel) ///
		coeflabel(	0.woman "Man" 1.woman "Woman" ///
					0.gender_post "Man" 1.gender_post "Woman" 2.messagetype#1.gender_post "Insult x Woman" 3.messagetype#1.gender_post "Threat x Woman" 4.messagetype#1.gender_post "Sexism x Woman" ///
					trust_index "Political trust"  2.messagetype#c.trust_index "Insult x Political trust" 3.messagetype#c.trust_index "Threat x Political trust" 4.messagetype#c.trust_index  "Sexism x Political trust") /// 
		drop(		1.messagetype#* ) ///
		note("Notes: OLS regression coefficients (standard errors, clustered by respondent). Out-party and in-party is determined by vote choice.") 
		
		
		*Primary models with alternative DV (without the item "I would report this message to...) (TABLE A2)
		esttab		aversion_ownparty_noreport aversion_lr_noreport aversion_trust_noreport aversion_genderpost_norep aversion_woman_noreport ///
					using primary_models_noreport.rtf, replace r2 b(2) se(2) compress wide label  interaction(" x ") noomitted nomtitles  ///
		order(		1.messagetype	2.messagetype 3.messagetype 4.messagetype 0.ownparty 1.ownparty 1.messagetype#1.ownparty 2.messagetype#1.ownparty 3.messagetype#1.ownparty 4.messagetype#1.ownparty /// 
					left_right  1.messagetype#c.left_right 2.messagetype#c.left_right 3.messagetype#c.left_right 4.messagetype#c.left_right ///
					trust_index 1.messagetype#c.trust_index 2.messagetype#c.trust_index 3.messagetype#c.trust_index 4.messagetype#c.trust_index ///
					0.gender_post 1.gender_post 1.messagetype#1.gender_post  2.messagetype#1.gender_post 3.messagetype#1.gender_post 4.messagetype#1.gender_post ///
					0.woman 1.woman 1.messagetype#1.woman 2.messagetype#1.woman 3.messagetype#1.woman 4.messagetype#1.woman ///
					_cons ) ///
		refcat(		1.messagetype "{\i Comment type:}" 0.ownparty "{\i Party vote:}" left_right "{\i Left-Right Position:}" 0.gender_post "{\i Gender of target:}"  0.woman "{\i Gender of respondent:}"   trust_index "{\i Political trust:}" ///
					, nolabel) ///
		coeflabel(	0.woman "Man" 1.woman "Woman" ///
					0.gender_post "Man" 1.gender_post "Woman" 2.messagetype#1.gender_post "Insult x Woman" 3.messagetype#1.gender_post "Threat x Woman" 4.messagetype#1.gender_post "Sexism x Woman" ///
					trust_index "Political trust"  2.messagetype#c.trust_index "Insult x Political trust" 3.messagetype#c.trust_index "Threat x Political trust" 4.messagetype#c.trust_index  "Sexism x Political trust" ) /// 
		drop(		1.messagetype#* ) ///
		note("Notes: OLS regression coefficients (standard errors, clustered by respondent). Out-party and in-party is determined by vote choice. In these models, the dependent variable is an index of aversion, which excludes the item "I would report this message to [Twitter/Facebook]"") 
		
		*Supplementary models - Covariates added (TABLE A3)
		esttab			aversion_ownparty_sup aversion_lr_sup aversion_trust_sup aversion_genderpost_sup aversion_woman_sup   using supplementary_models.rtf, replace r2 b(2) se(2) compress wide label  interaction(" x ") noomitted nomtitles  ///
		order(		1.messagetype	2.messagetype 3.messagetype 4.messagetype 0.ownparty 1.ownparty 1.messagetype#1.ownparty 2.messagetype#1.ownparty 3.messagetype#1.ownparty 4.messagetype#1.ownparty /// 
					left_right  1.messagetype#c.left_right 2.messagetype#c.left_right 3.messagetype#c.left_right 4.messagetype#c.left_right ///
					trust_index 1.messagetype#c.trust_index 2.messagetype#c.trust_index 3.messagetype#c.trust_index 4.messagetype#c.trust_index ///
					0.gender_post 1.gender_post 1.messagetype#1.gender_post  2.messagetype#1.gender_post 3.messagetype#1.gender_post 4.messagetype#1.gender_post ///
					0.woman 1.woman 1.messagetype#1.woman 2.messagetype#1.woman 3.messagetype#1.woman 4.messagetype#1.woman ///
					age _cons ) ///
		refcat(		1.messagetype "{\i Comment type:}" 0.ownparty "{\i Party vote:}" left_right "{\i Left-Right Position:}" 0.gender_post "{\i Gender of target:}"  0.woman "{\i Gender of respondent:}"   trust_index "{\i Political trust:}" ///
					, nolabel) ///
		coeflabel(	0.woman "Man" 1.woman "Woman" ///
					0.gender_post "Man" 1.gender_post "Woman" 2.messagetype#1.gender_post "Insult x Woman" 3.messagetype#1.gender_post "Threat x Woman" 4.messagetype#1.gender_post "Sexism x Woman" ///
					trust_index "Political trust"  2.messagetype#c.trust_index "Insult x Political trust" 3.messagetype#c.trust_index "Threat x Political trust" 4.messagetype#c.trust_index  "Sexism x Political trust" /// 
					age "{\i Age of respondent}") ///
		drop(		1.messagetype#* ) ///
		note("Notes: OLS regression coefficients (standard errors, clustered by respondent). Out-party and in-party is determined by vote choice. ") 

		*Supplementary models – Party preferences measured as party identity and party sympathy (TABLE A4)
		esttab		aversion_ownpartyID aversion_ownpartyIDnoleaner aversion_symp using sup_models_ID.rtf, replace r2 b(2) se(2) compress wide label  interaction(" x ") noomitted nomtitles  ///
		order(		1.messagetype	2.messagetype 3.messagetype 4.messagetype 0.ownpartyID 1.ownpartyID 1.messagetype#1.ownpartyID 2.messagetype#1.ownpartyID 3.messagetype#1.ownpartyID 4.messagetype#1.ownpartyID ///
					0.ownpartyIDnoleaner 1.ownpartyIDnoleaner 1.messagetype#1.ownpartyIDnoleaner 2.messagetype#1.ownpartyIDnoleaner 3.messagetype#1.ownpartyIDnoleaner 4.messagetype#1.ownpartyIDnoleaner ///
					fic_pol_sym 2.messagetype#c.fic_pol_sym 3.messagetype#c.fic_pol_sym 4.messagetype#c.fic_pol_sym _cons ) ///
		refcat(		1.messagetype "{\i Comment type:}" 0.ownpartyID "{\i Party identity:}" 0.ownpartyIDnoleaner "{\i Party identity (without leaners):}" fic_pol_sym "{\i Party sympathy:}", nolabel) ///
		coeflabel(	fic_pol_sym "Party sympathy" 2.messagetype#c.fic_pol_sym "Insult x Party sympathy" 3.messagetype#c.fic_pol_sym "Threat x Party sympathy" 4.messagetype#c.fic_pol_sym "Sexism x Party sympathy"  ) ///
		drop(		1.messagetype#* ) ///
		note("Notes: OLS regression coefficients (standard errors, clustered by respondent). Out-party and in-party is determined by party identity in models 1 and 2 (model 2 exclude leaners), and by party sympathy in model 3")
		
		
		*Supplementary models - Components of trust (TABLE A5)
		esttab 		trust0_10 trust_competent trust_personalgain using trustcomponent.rtf, replace r2 b(2) se(2) compress wide label  interaction(" x ") noomitted nomtitles  ///
		order(		1.messagetype	2.messagetype 3.messagetype 4.messagetype ///
					pol_trust_0_10  1.messagetype#c.pol_trust_0_10  2.messagetype#c.pol_trust_0_10  3.messagetype#c.pol_trust_0_10  4.messagetype#c.pol_trust_0_10  ///
					pol_competent  1.messagetype#c.pol_competent  2.messagetype#c.pol_competent  3.messagetype#c.pol_competent  4.messagetype#c.pol_competent  ///
					pol_personal_gain  1.messagetype#c.pol_personal_gain  2.messagetype#c.pol_personal_gain  3.messagetype#c.pol_personal_gain  4.messagetype#c.pol_personal_gain 	_cons ) ///
		refcat(		1.messagetype "{\i Comment type:}" pol_trust_0_10 "{\i General trust (0-10):}" pol_competent "{\i Most politicians are competent (...):}" ///
					pol_personal_gain "{\i Most politicians are in politics (...) get out of it personally:}"   ///
					, nolabel) ///
		coeflabel(	0.woman "Man" 1.woman "Woman" ///
					0.gender_post "Man" 1.gender_post "Woman" 2.messagetype#1.gender_post "Insult x Woman" 3.messagetype#1.gender_post "Threat x Woman" 4.messagetype#1.gender_post "Sexism x Woman" ///
					trust_index "Political trust"  2.messagetype#c.trust_index "Insult x Political trust" 3.messagetype#c.trust_index "Threat x Political trust" 4.messagetype#c.trust_index  "Sexism x Political trust" ) /// 
		drop(		1.messagetype#* ) ///
		note("Notes: OLS regression coefficients (standard errors, clustered by respondent).") 
		
				
		*Interactions between gender of attacked politician and gender of respondent (TABLE A6)
		esttab	aversion_respondent_target using exploratory_respondenttarget.rtf, replace r2 b(2) se(2) compress wide label  interaction(" x ") noomitted nomtitles  ///
		refcat(		1.messagetype "{\i Comment type:}" , nolabel) ///
		drop(1.messagetype#* ) ///
		note("Notes: OLS regression coefficients (standard errors, clustered by respondent).") 		

		
*************
***THE END***	
*************

